<template>
  <!-- 收益页面 -->
  <div class="earnings">
    <van-nav-bar title="我的推广" left-arrow @click-left="onClickLeft" />
    <div class="head">
      <div class="left">
        <p>可提现收益</p>
        <strong>￥81.00</strong>
      </div>
      <div class="right">
        <p>佣金总额</p>
        <strong>￥108.00</strong>
      </div>
    </div>
    <ul class="list">
      <li @click="detail">
        <div>
          <span>佣金明细</span>
        </div>
        <van-icon name="arrow" size="1rem" />
      </li>
      <li>
        <div>
          <span>提现记录</span>
        </div>
        <van-icon name="arrow" size="1rem" />
      </li>
      <li class="mt">
        <div>
          <span>结算佣金</span>
        </div>
        <van-icon name="arrow" size="1rem" />
      </li>
    </ul>
    <div class="pd">
      <van-button
        type="primary"
        size="large"
        color="#FFC71C"
        @click="withdrawal"
        >去提现</van-button
      >
    </div>
    <div class="footer">
      <p>推广账号到账后次日可提现</p>
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  name: 'Earnings',
  data() {
    return {}
  },
  methods: {
    onClickLeft() {
      this.$router.push('/promote')
    },
    detail() {
      this.$router.push('/detail')
    },
    withdrawal() {
      Toast.fail('次日可提现')
    },
  },
}
</script>

<style lang="less" scoped>
@import '@/style/common.less';
:deep(.van-nav-bar .van-icon) {
  color: black;
}
:deep(.van-nav-bar__title) {
  font-size: 18px;
  font-weight: bold;
}
.earnings {
  background-color: @242;
  .head {
    background: @ffc;
    height: 10rem;
    width: 100%;
    display: flex;
    strong {
      font-size: 2rem;
    }
    color: @cf;
    .left {
      width: 50%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
    .right {
      width: 50%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
  }
  .list {
    margin-top: 1rem;
    .mt {
      margin-top: 2%;
    }
    li {
      height: 9vh;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 0.01rem solid #eee;
      padding: 0 2%;
      background: #fff;
      .mt {
        margin-top: 2%;
      }
      div {
        display: flex;
        align-items: center;
      }
      span {
        padding-left: 0.3rem;
        font-weight: bold;
      }
    }
  }
  .pd {
    margin: 0 8%;
    margin-top: 24%;
  }
  .footer {
    p {
      text-align: center;
      padding-bottom: 2vh;
    }
  }
}
</style>
